<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Title</title>
    <script src="../utils/jquery3-7-1.js"></script>
  </head>
  <body>
    <div class="title">
     
      <button id="logout">退出登录</button>
    </div>
    <script>
      $(function () {
        var username = $("#username").val();
        var password = $("#password").val();
        $("#logout").click(() => {
          $.ajax({
            type: "POST",
            url: "http://127.0.0.1/loginout",
            data: { username: username, password: password },
            success: (res) => {
              console.log(res.msg);
              window.location.href = "./login.html";
            },
          });
        });


      });
    </script>
  </body>
</html>
